<template>
	<view>
		
		
		<orderCommon
			:text="text" :order="order" :afterSalesRecord="afterSalesRecord" :is_time="false" :is_chat="true"
			:customStyle1="customStyle1" :customStyle11="customStyle11" 
			:customStyle2="customStyle2" :customStyle3="customStyle3">
		</orderCommon>
		
		
		<view class="cardBox" style="margin-top: 10rpx;width: 94%;
		margin: 0 auto;
		margin-top: 30rpx;
		box-shadow: 0 0 10px #ddd;
		background: #ddd;
		padding: 10rpx 20rpx;
		border-radius: 20rpx;
		background: #fff;
		margin-bottom: 30rpx;
		position: relative;">
			<view  style="margin-top: 10rpx;padding-bottom: 20rpx;">
				<image :src="IMAGE_URL+order.join_user.avatar" class="close_image2" style="width: 120rpx;height: 120rpx;border-radius: 20rpx; margin-right: 20rpx; margin-top: 20rpx; float: left;"></image>
				<view style="line-height: 140rpx;float: left;">
					<block v-if="lang==='zh'">{{order.join_user.username}}</block>
					<block v-if="lang==='ru'">{{order.join_user.username_ru}}</block>
				</view>
				
				<view style="clear: both;"></view>
				<view style="font-size:28rpx;padding-top: 10rpx;">{{text.burenke}} </view>
				
				<view class="flex" style="margin-top: 10rpx;padding-bottom: 20rpx;color: #999;">
					<view style="width: 50%;float: left; text-align: left;" >
						{{timestampToDate(afterSalesRecord.appeal_time*1000)}}
						
					</view>
				</view>
				<view style="clear: both;"></view>
					
			</view>
		</view>
		
		
		<appealCommon
			:text="text" :order="order" :afterSalesRecord="afterSalesRecord" 
			:customStyle1="customStyle1" :customStyle11="customStyle11" 
			:customStyle2="customStyle2" :customStyle3="customStyle3">
		</appealCommon>
			
			
		<!-- <view style="padding-bottom: 20rpx;width:96%;margin-left: 2%;">
			<u-button  style="float: right;margin-right: 10rpx;" :custom-style="customStyle3" hover-class="none" :disabled="subDisabled" type="primary"
				>
				{{ $t('等待对方处理') }}
			</u-button>
			<u-button @click="chexiao()" style="float: right;margin-right: 10rpx;" :custom-style="customStyle1" hover-class="none" :disabled="subDisabled" type="primary"
				>
				{{ $t('撤销申请') }}
			</u-button>
			<view style="clear: both;"></view>
		</view> -->
			
		
			
		<view style="height: 50px;"></view>
	
	</view>
</template>


<script>
	import {HTTP_REQUEST_URL,HTTP_IMG_UTL,IMAGE_URL} from "@/config/app";
	import orderCommon from './orderCommon.vue';
	import appealCommon from './appealCommon.vue';
	
	export default {
		components:{
			orderCommon,appealCommon
		},
		props:{
			order:{
				type:Object,
				default:{}
			},
			afterSalesRecord:{
				type:Object,
				default:{}
			},
			text:{
				type:Object,
				default:{}
			},
			customStyle1:{
				type:Object,
				default:{}
			},
			customStyle11:{
				type:Object,
				default:{}
			},
			customStyle2:{
				type:Object,
				default:{}
			},
			customStyle3:{
				type:Object,
				default:{}
			},
		},
		data() {
			return {
				//远程域名
				HTTP_IMG_UTL,
				HTTP_REQUEST_URL,
				IMAGE_URL,
				url: IMAGE_URL,
				
				//语言
				lang: this.$i18n.locale,
				
				img:HTTP_IMG_UTL+'huangjin.png',
				subDisabled:false,
				disabled:false,
				
			}
		},
		methods:{
			timestampToDate(timestamp) {
			  const date = new Date(timestamp); // 如果timestamp是数值，可以直接作为Date构造函数的参数
			  const year = date.getFullYear();
			  const month = (date.getMonth() + 1).toString().padStart(2, '0');
			  const day = date.getDate().toString().padStart(2, '0');
			  const hours = date.getHours().toString().padStart(2, '0');
			  const minutes = date.getMinutes().toString().padStart(2, '0');
			  const seconds = date.getSeconds().toString().padStart(2, '0');
			  return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
			},
			chexiao(){
				const that = this
				that.$u.api.order.appealRevoke({
					aftersales_id :that.order.orderInfo.aftersales_id,
					lang:that.lang
				}).then(res => {
					uni.showModal({
						content: that.$t('操作成功'),
						showCancel: false,
						confirmText: this.$t('是'),
					})
					setTimeout(function() {
						uni.navigateBack({
							delta: -1
						});
					}, 2000);
					return false;
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.cardBox {
		width: 94%;
		margin: 0 auto;
		margin-top: 30rpx;
		box-shadow: 0 0 10px #ddd;
		background: #ddd;
		padding: 10rpx 20rpx;
		border-radius: 20rpx;
		background: #fff;
		margin-bottom: 30rpx;
		position: relative;
	}
	.flex{width: 100%;display: flex;}
	.close_image2{
		width: 120rpx;height: 120rpx;border-radius: 20rpx; margin-right: 20rpx; margin-top: 20rpx; float: left;
	}
}
<style>